package com.example.spidertp.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.spidertp.core.mapper.TpRejectedExecutionRecordMapper;
import com.example.spidertp.core.model.entity.TpRejectedExecutionRecord;
import com.example.spidertp.core.model.param.QueryParam;
import com.example.spidertp.core.service.TpRejectedExecutionRecordService;
import org.springframework.stereotype.Service;

/**
 * @author xiong.bo
 * @version 1.0
 * @date 2022/10/6 8:09 下午
 */

@Service
public class TpRejectedExecutionRecordServiceImpl extends ServiceImpl<TpRejectedExecutionRecordMapper, TpRejectedExecutionRecord>
        implements TpRejectedExecutionRecordService {


    @Override
    public IPage<TpRejectedExecutionRecord> selectByPage(QueryParam param) {
        Page<TpRejectedExecutionRecord> page = new Page(param.getPage(),param.getSize());
        LambdaQueryWrapper<TpRejectedExecutionRecord> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderByDesc(TpRejectedExecutionRecord::getCreateTime);
        return page(page, queryWrapper);
    }
}
